<?php
/**
 * Created by PhpStorm.
 * User: admin
 * Date: 2018/9/14
 * Time: 17:20
 * Description: 供应商物流运费“按区域设置”扩展表
 */
class MaintenanceSupplierLogisticsFreightArea extends Eloquent
{
    protected $table = "maintenance_supplier_logistics_freight_area";
    
    /**
     * @Author:          zk
     * @DateTime:        18-9-15 上午10:56
     * @Description:     根据供应商ID获取该供应商物流运费“按区域设置”的列表
     * @param int $supplier_id  供应商ID
     * @return array
     */
    public static function getAreaList($supplier_id) {
        $select_arr = [
            'area.supplier_id', 'area.city_id', 'area.logistics_freight', 
            'resource_city.city_name', 
        ];
        $list = DB::table('maintenance_supplier_logistics_freight_area AS area')
                ->leftJoin('anhui_data.resource_city', 'area.city_id', '=', 'resource_city.id')
                ->select($select_arr)
                ->where('area.supplier_id', $supplier_id)
                ->get();
        return $list;
    }
    
}